﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using IFRS.Web;
using System.Data;

public partial class Index_Default : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        if ((FileData.PostedFile != null) && (FileData.PostedFile.ContentLength > 0))
        {
            DataTable dt = new DataTable();
            string sExtension = Path.GetExtension(FileData.FileName);
            string sFilename = FileData.FileName;
            string newFilename = "";
            string SaveLocation = "";
            newFilename = "MAT_TF_" + DateTime.Now.ToString("yyyymmdd_hhmmss") + ".xls";
            SaveLocation = Server.MapPath("~/Temp/") + newFilename;
            FileData.SaveAs(SaveLocation);

            dt = GetDataTabletFromCSVFile(SaveLocation);
        }
    }
}